/* eslint-disable require-atomic-updates */
const Koa = require('koa')
const app = new Koa()

app
    .use(async (ctx, next) => {
        ctx.body = '<h3>第一层请求</h3>'
        await next()
        ctx.body += '<h3>第一层响应</h3>'
    })
    .use(async (ctx, next) => {
        ctx.body += '<h2>第二层请求</h2>'
        await next()
        ctx.body += '<h2>第二层响应</h2>'
    })
    .use(async (ctx, next) => {
        ctx.body += '<h1>第三层请求</h1>'
        await next()
        ctx.body += '<h1>第三层响应</h1>'
    })
    .use(async (ctx) => {
        ctx.body += '<p>处理业务<p>'
    })
    .listen(3000)
    
console.log('http://localhost:3000')